﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>This is a sample Person object</title>    
</head>
    <body>
        <p>
            The full name of the person in this example is <span id="name"></span>
        </p>
        <script src="../Scripts/jquery-1.8.2.min.js"></script>
        <script type="text/javascript">
            var TypeScriptingStuff; //namespace
            (function (typeScriptingStuff) {
                var person = (function () {
                    function Person(firstName, lastName) {
                        this.FirstName = firstName;
                        this.LastName = lastName;
                    }
                    Person.prototype.getFullName = function () {
                        return this.FirstName + " " + this.LastName;
                    };
                    return Person;
                })();
                typeScriptingStuff.Person = person;
            })(TypeScriptingStuff || (TypeScriptingStuff = {}));

            var instance = new TypeScriptingStuff.Person('pato', 'balenzuela');
            $('#name').text(instance.getFullName());
        </script>
    </body>
</html>
